package priv.pfz.sbv;

import com.google.common.collect.Lists;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author yyjxp
 * 2024/2/15 1:06
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
public class CreateBeanOpData {

    private String beanName;
    private CreateBeanOpType opType;
    private long time;

    private static final List<CreateBeanOpData> DATA_LIST = Lists.newLinkedList();

    public static void log(String beanName, CreateBeanOpType opType) {
        DATA_LIST.add(new CreateBeanOpData(beanName, opType, System.nanoTime()));
    }

    public static List<CreateBeanOpData> get() {
        return DATA_LIST;
    }
}
